<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/7/1
  Time: 9:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$</title>
    <link rel="stylesheet" href="css/css.css">
    <link rel="stylesheet" href="css/img.css">
    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/fileupload.js"></script>
    <script src="js/validate.js"></script>
    <script src="js/jquery.validate.js"></script>
    <script>
        function yz() {
            $.ajax({
                url:"yz.do",
                data:{"uname":$("[name='uname']").val()},
                type:"post",
                dataType:"json",
                success:function (obj) {
                    if (obj>0){
                        alert("用户存在不可以注册")
                    }else{
                        alert("可以注册")
                        $("form").submit()
                    }
                }
            })
        }
    </script>
</head>
<body>
<form method="post" action="/addRegister.do">
<%--    编号:<input type="text" name="uid"><br>--%>
    账号:<input type="text" name="uname"><br>
    密码:<input type="text" name="pwd"><br>
    昵称:<input type="text" name="nick"><br>
    <input type="button" value="注册" onclick="yz()">
</form>
</body>
</html>
